<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('Basicdata/index')}">列表</a></li>
        <li><a href="{:url('Basicdata/add')}">添加</a></li>
    </ul>
    <form class=" well form-inline margin-top-20" method="get" action="{:url('Basicdata/index')}">
        姓名:
        <input type="text" class="form-control" name="key_name" style="width:150px;"
               value="" placeholder="">

        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger" href="{:url('Basicdata/index')}">清空</a>
    </form>
    <table class="table table-hover table-bordered">
        <thead>
        <tr>
                            <th>牌号id</th>
                            <th>牌号</th>
                        <th width="150">操作</th>
        </tr>
        </thead>
        <tbody>
        <foreach name="lists['data']" item="vo">        <tr>
                            <td>
                    {$vo['g_id']}                </td>
                            <td>
                    {$vo['g_name']}                </td>
                        <td>
                <a class="btn btn-xs btn-primary" href="{:url('Basicdata/edit',['id'=>$vo['id']])}">编辑</a>
                <a class="btn btn-xs btn-danger js-ajax-delete" href="{:url('Basicdata/del',['id'=>$vo['id']])}">删除</a>
            </td>
        </tr>
        </foreach>        </tbody>
    </table>
    <div class="pagination">{$page}</div>
</div>
<script src="/static/js/admin.js"></script>
<script src="/static/js/layer/layer.js"></script>
<script>
    function see(obj) {
        layer.open({
            content: $(obj).text().trim()
        });
    }

    function detail(id, field) {
        $.ajax({
            url: '{:url('Basicdata/field')}?id=' + id + '&field=' + field,
            type: 'get',
            success(res) {
                if (res.code == 1) {
                    let tpl = '';
                    for (const item of res.data) {
                        tpl += `<p>地址：<input value="${item}" readonly class="form-control" style="width:80%;display: inline-block;" type="text">&nbsp;<a target="_blank" href="{$domain}${item}" class="btn btn-success">跳转</a></p>`;
                    }
                    layer.open({
                        area: ['60%', '100%'],
                        content: tpl
                    });
                } else {
                    layer.msg('查看失败');
                }
            }
        });
    }
</script>
</body>
</html>
</body>
</html>
